package com.lanqiao.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.format.annotation.NumberFormat;

import java.util.Date;

/**
 * @author 张建平 on 2020/8/14.
 */

//@Getter
//@Setter
@Data // 包含了 @Getter，@Setter，@ToString
@NoArgsConstructor // 生成默认构造
@AllArgsConstructor // 生成全参数构造
//@ToString   // 生成toString()
public class ExampleBean {

    @DateTimeFormat(pattern = "yyyy/MM/dd")
    private Date orderDate;

    @NumberFormat(pattern="#,###.00")
    private Double orderPrice;

    public static void main(String[] args){

        ExampleBean bean = new ExampleBean(new Date(), 88.9);

        System.out.println(bean.getOrderDate());

        System.out.println(bean.toString());

        //Fri Aug 14 09:07:08 KRAT 2020
        //ExampleBean(orderDate=Fri Aug 14 09:07:08 KRAT 2020, orderPrice=88.9)
    }
}
